package zuoye

import "fmt"

func main() {
	//作业1.每种基本类型的变量，各声明5个变量，并打印变量的数值，以及类型。
	//1.整数类型
	var num1 int
	num1 = 1
	var num2 int = 2
	var num3 = 3
	num4 := 4
	var (
		num5 = 5
		num6 = 6
	)
	var num7 int
	var num8 int8
	var num9 int16
	var num10 int32
	var num11 int64
	fmt.Println(num1, num2, num3, num4, num5, num6,num7,num8,num9,num10,num11)
	num12 := 'A'
	fmt.Printf("%v,%q,%d,%T\n",num12,num12,num12,num12)
	//2.布尔类型
	var bool1 bool
	bool1 =true
	var bool2 bool = false
	var bool3 = true
	bool4 := false

	var (
		bool5 = true
		bool6 = false
	)
	var bool7 bool
	fmt.Println(bool1,bool2,bool3,bool4,bool5,bool6,bool7)
	//3.浮点类型/小数类型
	var float1 float32
	float1 = 1.23
	fmt.Printf("%f，%T\n",float1,float1)
	var float2 float32 = 3.14
	fmt.Printf("%f，%T\n",float2,float2)

	var float3 = 22.34
	fmt.Printf("%f，%T\n",float3,float3)
	float4 := 5.34
	fmt.Printf("%f，%T\n",float4,float4)

	var (
		float5 = 5.66
		float6 = 4.33
	)
	var float7 float64
	fmt.Printf("%f，%T,%f，%T\n",float5,float5,float6,float6)
	fmt.Println(float7)
	//字符串型
	var s1 string
	s1 ="a" //一个字符
	var s2 string = "abc" //多个字符
	var s3 = "今天天气好" //用汉字
	s4 := 'a' //单引号是int32
	s5 := "" //没有字符
	s6 := " " //空格
	s7 := `芭啦芭啦樱之花` //esc下面的括号
	fmt.Printf("s1,%s,%v,%q,%T\n",s1,s1,s1,s1)
	fmt.Printf("s2,%s,%v,%q,%T\n",s2,s2,s2,s2)
	fmt.Printf("s3,%s,%v,%q,%T\n",s3,s3,s3,s3)
	fmt.Printf("s4,%d,%v,%q,%T\n",s4,s4,s4,s4)
	fmt.Printf("s5,%s,%v,%q,%T\n",s5,s5,s5,s5)
	fmt.Printf("s6,%s,%v,%q,%T\n",s6,s6,s6,s6)
	fmt.Printf("s7,%s,%v,%q,%T\n",s7,s7,s7,s7)





}
